﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HarveyNash.RefactoringAndCodeSmell.CodeSmell.ConditionalComplexity
{
    public static class Before
    {        
        public static IpodTouchGeneration GetIpodTouchGeneration(string modelNumber, DiskCapacity capacity)
        {
            if (modelNumber.Equals("MA623L", StringComparison.OrdinalIgnoreCase) 
                || modelNumber.Equals("MA627L", StringComparison.OrdinalIgnoreCase))
                return IpodTouchGeneration.FirstGeneration;
            else if (modelNumber.Equals("MB528L", StringComparison.OrdinalIgnoreCase) 
                  || modelNumber.Equals("MB531L", StringComparison.OrdinalIgnoreCase))
                return IpodTouchGeneration.SecondGeneration;
            else if (modelNumber.Equals("MC086L", StringComparison.OrdinalIgnoreCase) 
                  || modelNumber.Equals("MC008L", StringComparison.OrdinalIgnoreCase)
                  || (modelNumber.Equals("MC540L", StringComparison.OrdinalIgnoreCase) && capacity == DiskCapacity.Capacity8GB))
                return IpodTouchGeneration.ThirdGeneration;
            else if (modelNumber.Equals("MC540L", StringComparison.OrdinalIgnoreCase) 
                  || modelNumber.Equals("MC544L", StringComparison.OrdinalIgnoreCase))
                return IpodTouchGeneration.FourthGeneration;

            return IpodTouchGeneration.FirstGeneration;
        }
    }
}
